package com.ebring.shareEducation.controller;


import com.ebring.shareEducation.bean.Task;
import com.ebring.shareEducation.bean.Ustaccount;
import com.ebring.shareEducation.service.TaskService;
import com.ebring.shareEducation.service.UstAccountService;
import com.ebring.shareEducation.utils.RspMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UstAccountController {

    @Autowired
    private UstAccountService ustAccountService;

    /**
     * 查询所有余额列表
     *
     * @return
     */
    @GetMapping("/ustaccount/list")
    public RspMsg<Ustaccount> select() {
        return ustAccountService.selectust();
    }

    /**
     * 修改余额
     */
       @PostMapping("/ustaccount/update")
    public RspMsg<Ustaccount> updateTask(Ustaccount ustaccount) {
           return ustAccountService.updateUst(ustaccount);
    }





    /**
     * 新增余额
     *
     * @return
     */

    @PostMapping("/Ustaccount/insertMenu")
    public RspMsg<Ustaccount> insertUst(String userid,String bid) {
        return ustAccountService.insertust(userid,bid);
    }



    /**
     * 查询用户下面的余额
     *
     * @param uid
     * @return
     */
    @PostMapping("/Ustaccount/select")
    public RspMsg<Ustaccount> selectTask(String uid){
        return ustAccountService.selectUstaccountbyuserid(uid);
    }




}
